jquery教程

推荐列表 站点导航

当前位置:首页 > jquery > jquery教程 >

javascript实现页面刷新的几种方法

来源:网络整理  作者:fen  发布时间:2020-12-26 14:26
本文介绍下,如何用javascript实现web页面的刷新,介绍了几种常用的方法,供大家参考。...

Javascript刷新页面的常见方法: 1、history.go(0) 2、location.reload() 3、location=location 4、location.assign(location) 5、document.execCommand('Refresh') 6、window.navigate(location) 7、location.replace(location) 8、document.URL=location.href 自动刷新页面的方法: 1. 页面自动刷新:把如下代码加入head区域中 meta http-equiv=refresh content=20 其中20指每隔20秒刷新一次页面. 2. 页面自动跳转:把如下代码加入head区域中 meta http-equiv=refresh content=20;url=http://ym97.com/wenku 其中20指隔20秒后跳转到页面 3. 页面自动刷新js版 复制代码 代码示例: script language=JavaScript function myrefresh() { window.location.reload(); } setTimeout('myrefresh()',1000); // 指定1秒刷新一次 /script 一、ASP.NET 如何输出刷新父窗口脚本语句 title=语句 语句 复制代码 代码示例: 1. this.response title=response response.write(scriptopener.location.reload();/script); 2.this.response title=response response.write(scriptopener.window.location.href = opener.window.location.href;/script); 3.Response.Write(script language=javascript gt;opener.window.navigate(''你要刷新的页.asp'');/script) 二、JS 刷新框架的脚本语句 title=语句 语句 复制代码 代码示例: // 如何刷新包含该框架的页面用 script language=JavaScript parent.location.reload(); /script // 子窗口刷新父窗口 script language=JavaScript self.opener.location.reload(); /script ( 或 a href=javascript:opener.location.reload()刷新/a ) // 如何刷新另一个框架的页面用 script language=JavaScript parent.otherFrameID.location.reload(); /script 如果想关闭窗口或开窗时刷新的话, 代码如下: 复制代码 代码示例: body onload=opener.location.reload() gt; 开窗时刷新 body onUnload=opener.location.reload() gt; 关闭时刷新 script language=javascript window.opener.document.location.reload() /script ,在body中调用以下语句 title=语句 语句即可,。

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jq/jc/9289.shtml

相关文章
最新文章
PHP识别相片是否是颠倒的 PHP识别相片是否是颠倒的

时间:2020-12-28

python编程有哪些ide python编程有哪些ide

时间:2020-12-28

python开发工程师是做什么 python开发工程师是做什么

时间:2020-12-28

php构造函数的作用 php构造函数的作用

时间:2020-12-28

php怎么跟数据库连接 php怎么跟数据库连接

时间:2020-12-28

php实现顺序线性表 php实现顺序线性表

时间:2020-12-28

Python多重继承中的菱形继 Python多重继承中的菱形继

时间:2020-12-28

php中break的作用 php中break的作用

时间:2020-12-28

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

javascript实现页面刷新的几种方法

2020-12-26 编辑:fen

Javascript刷新页面的常见方法: 1、history.go(0) 2、location.reload() 3、location=location 4、location.assign(location) 5、document.execCommand('Refresh') 6、window.navigate(location) 7、location.replace(location) 8、document.URL=location.href 自动刷新页面的方法: 1. 页面自动刷新:把如下代码加入head区域中 meta http-equiv=refresh content=20 其中20指每隔20秒刷新一次页面. 2. 页面自动跳转:把如下代码加入head区域中 meta http-equiv=refresh content=20;url=http://ym97.com/wenku 其中20指隔20秒后跳转到页面 3. 页面自动刷新js版 复制代码 代码示例: script language=JavaScript function myrefresh() { window.location.reload(); } setTimeout('myrefresh()',1000); // 指定1秒刷新一次 /script 一、ASP.NET 如何输出刷新父窗口脚本语句 title=语句 语句 复制代码 代码示例: 1. this.response title=response response.write(scriptopener.location.reload();/script); 2.this.response title=response response.write(scriptopener.window.location.href = opener.window.location.href;/script); 3.Response.Write(script language=javascript gt;opener.window.navigate(''你要刷新的页.asp'');/script) 二、JS 刷新框架的脚本语句 title=语句 语句 复制代码 代码示例: // 如何刷新包含该框架的页面用 script language=JavaScript parent.location.reload(); /script // 子窗口刷新父窗口 script language=JavaScript self.opener.location.reload(); /script ( 或 a href=javascript:opener.location.reload()刷新/a ) // 如何刷新另一个框架的页面用 script language=JavaScript parent.otherFrameID.location.reload(); /script 如果想关闭窗口或开窗时刷新的话, 代码如下: 复制代码 代码示例: body onload=opener.location.reload() gt; 开窗时刷新 body onUnload=opener.location.reload() gt; 关闭时刷新 script language=javascript window.opener.document.location.reload() /script ,在body中调用以下语句 title=语句 语句即可,。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jq/jc/9289.shtml

相关文章

风云图片

推荐阅读

返回jquery教程频道首页